home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group97a.txt
/
000001_icon-group-sender _Fri Jan 3 06:46:00 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Received: by cheltenham.cs.arizona.edu; Fri, 3 Jan 1997 17:23:10 MST
From: eka@corp.cirrus.com (Eka Laiman)
Message-Id: <9701031442.AA08170@ss492.corp.cirrus.com>
Subject: Re: Help for an Icon Neophyte
To: robinstu@ohsu.edu
Date: Fri, 3 Jan 1997 06:46:00 -0800 (PST)
Cc: icon-group@cs.arizona.edu
In-Reply-To: <no.id> from "Stuart Robinson" at Jan 2, 97 11:02:16 am
X-Mailer: ELM [version 2.4 PL24alpha3]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 1651
> I have run into the following problems. First, I was unsuccessful at
> mapping lowercase letters on to uppercase letters. I assume that I want
> to use something like map(line, &ucase, &lcase), but where should I
> insert it? And should the csets &ucase and &lcase be bracketted by
> single quotations marks? Second, the program seems to hang up at the
> end. I have no idea why that's happening.
>
> Eventually I would like to have the program do the log-log plot, but for
> now I can use the resulting output for exportation.
>
> Thanks in advance for any help you can provide.
May I suggest how I would approach the problem?
1. I would use a table to store the different words. (I do not have my
ICON book with me at present - I am out of town), it is done with
something like:
wordtbl := table(0)
2. Read the text line by line.
while (inline := read()) do {
// process the line here
}
// process the result here
3. For each line do the following:
3.1. Map all non alphanumeric characters into "blank" (white space).
This can be done by defining the set of non-alphanumeric characters
at the outset of the program. Again something like:
non_alnum := &cset --- &alnum
(I don't remember the exact keywords).
3.2. Map the upper case to the lower case.
The mapping process would read like:
inline := map(inline, source, dest)
4. Now break "inline" into words and store the count of each word in the
"wordtbl".
5. When out of the "while read" loop, do something (again like this):
every word := key(wordtbl) do {
write(word || "\t" || wordtbl[word])
}
-eka-